Crash when reading bit map image in python